@extends('backend.layouts.app')

@section('content')
<div class="layui-card">
    <div class="layui-card-header layui-card-header-auto">为用户选择角色</div>
    <div class="layui-card-body">
        <form class="layui-form" action="{{route('admin.auth.manager.role.save',['id'=>$id])}}" method="POST">
            {{method_field('put')}}
            @csrf
            <div class="layui-form-item">
                <label class="layui-form-label">选择角色</label>
                <div class="layui-input-block">
                    @foreach ($roles as $item)
                    <input type="checkbox" lay-skin="primary" name="role[]" value="{{$item['role_id']}}" title="{{$item['name']}}">
                    @endforeach
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn" lay-submit="" lay-filter="formDemo">确 认</button>
                    <a class="layui-btn" href="{{route('admin.auth.manager.index')}}">返 回</a>
                </div>
            </div>
        </form>
    </div>
</div>
@endsection

{{-- @section('script')
<script type="text/javascript">
    layui.use(['form'], function () {
        let form = layui.form;
        //自定义验证规则
        form.verify({});
    });

</script>
@endsection --}}
